package com.cipe.cmrs.bean;

import java.util.ArrayList;
import java.util.List;

public class RestrictedUiElementBean {
 
	private Integer id;
	private String nameOrValue;
	private String submenuOrForm; 
	private List<RestrictedUiElementRoleEntryBean> rolesEntryList;	

	public RestrictedUiElementBean() {
		super();
	}	
	
	public RestrictedUiElementBean(Integer id, String submenuOrForm, String nameOrValue) {
		super(); 
		this.id = id;
		this.submenuOrForm = submenuOrForm;
		this.nameOrValue = nameOrValue;
		rolesEntryList = new ArrayList<RestrictedUiElementRoleEntryBean>();
	}	

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getSubmenuOrForm() {
		return submenuOrForm;
	}

	public void setSubmenuOrForm(String submenuOrForm) {
		this.submenuOrForm = submenuOrForm;
	}	

	public List<RestrictedUiElementRoleEntryBean> getRolesEntryList() {
		return rolesEntryList;
	}

	public void setRolesEntryList(List<RestrictedUiElementRoleEntryBean> rolesEntryList) {
		this.rolesEntryList = rolesEntryList;
	}

	public String getNameOrValue() {
		return nameOrValue;
	}

	public void setNameOrValue(String nameOrValue) {
		this.nameOrValue = nameOrValue;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((nameOrValue == null) ? 0 : nameOrValue.hashCode());
		result = prime * result
				+ ((submenuOrForm == null) ? 0 : submenuOrForm.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		RestrictedUiElementBean other = (RestrictedUiElementBean) obj;
		if (nameOrValue == null) {
			if (other.nameOrValue != null)
				return false;
		} else if (!nameOrValue.equals(other.nameOrValue))
			return false;
		if (submenuOrForm == null) {
			if (other.submenuOrForm != null)
				return false;
		} else if (!submenuOrForm.equals(other.submenuOrForm))
			return false;
		return true;
	}
}
